package Interpreter.Function;

import Interpreter.InterpreterVisitor;
import ast.*;
import java.util.ArrayList;

/**
 *
 * @author Stephen
 */
public class AlertFunction extends Function {

    @Override
    public Object execute(ArrayList args) {
        String locationToAlert = ((IdTree)args.get(0)).getSymbol().toString();
        String alert = ((AST)args.get(1)).accept(new InterpreterVisitor()).toString();
        System.out.println("#" + locationToAlert + "# " + alert);
        return "#" + locationToAlert + "# " + alert;
    }
}
